package com.situ.water_system.controller;


import com.situ.water_system.pojo.SyEmp;
import com.situ.water_system.pojo.SyMenu;
import com.situ.water_system.service.SyEmpService;
import com.situ.water_system.service.SyMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.Calendar;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Angel
 * @since 2020-12-01
 */
@RestController
@RequestMapping("/Symenu")
public class SyMenuController {
    @Autowired
    private SyMenuService service;
    @RequestMapping("/queryall")
    public List<SyMenu> queryall() {
        return service.selectList();
    }

    @RequestMapping("/queryByid/{id}")
    public SyMenu queryByid(@PathVariable(name = "id") Integer id) {
        return service.selectByid(id);
    }

    @RequestMapping("/del/{id}")
    public int del(@PathVariable(name = "id") Integer id) {
        return service.del(id);
    }

    @RequestMapping("/add")
    public int insert(SyMenu syArea) {
        return service.add(syArea);
    }

    @RequestMapping("/update")
    public int update(SyMenu syArea) {
        return service.update(syArea);
    }
}

